<?php

namespace app\api\controller\admin;

use app\common\controller\Api;
use app\api\service\admin\RoleService;

class Role extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = [];
    

    

    /**
     * 查看
     */
    public function index()
    {
        $data = $this->request->post();
        $res = RoleService::index($data);
        return json($res);
    }

    /**
     * 添加
     */
    public function add()
    {
        $data = $this->request->post();
        $res = RoleService::add($data);
        return json($res);
    }

    /**
     * 编辑
     */
    public function edit()
    {
        $data = $this->request->post();
        $res = RoleService::edit($data);
        return json($res);
    }

    /**
     * 删除
     */
    public function del()
    {
        $data = $this->request->post();
        $res = RoleService::del($data);
        return json($res);
    }

    /**
     * 获取身份下员工
     */
    public function get_staff()
    {
        $data = $this->request->post();
        $res = RoleService::getStaff($data);
        return json($res);
    }
    
}